/*******************************************************************************
*  file    : saveloadobjectjson.hpp
*  created : 07.08.2014
*  author  : Slyshyk Oleksiy (alexSlyshyk@gmail.com)
*******************************************************************************/

#ifndef SAVELOADOBJECTJSON_HPP
#define SAVELOADOBJECTJSON_HPP

#include <QObject>
#include <interfaces.hpp>

class SaveLoadObjectJson : public QObject, public SaveLoadObjectInterface
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "tmx.com.ua.dsp.lab.SaveLoadObjectInterface" FILE "save_load_object_json.json")
    Q_INTERFACES(SaveLoadObjectInterface)
public:
    explicit SaveLoadObjectJson(QObject *parent = 0);
public:
    virtual QString     name() const;
    virtual QString     error() const;
    virtual QStringList formats() const;
    virtual QString     fileFilter() const;
    virtual bool        saveObjectToFile(const QString& fileName, QObject* object);
    virtual QObject*    loadObjectFromFile(const QString& fileName);
private:
    QString lastError_;
};

#endif // SAVELOADOBJECTJSON_HPP
